CREATE TABLE [dbo].[Relation_kafedra_prep]
(
[ik_kaf] [int] NOT NULL,
[itab_n] [int] NOT NULL,
[ik_work_type] [int] NOT NULL,
[ik_capacity] [int] NULL,
[ik_defence_fund] [tinyint] NULL,
[f_rates] [float] NULL,
[ik_id_prepod] [int] NOT NULL IDENTITY(1, 1),
[release_date] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Relation_kafedra_prep] ADD CONSTRAINT [PK_Relation_kafedra_prep_1] PRIMARY KEY CLUSTERED  ([ik_id_prepod]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Relation_kafedra_prep] ADD CONSTRAINT [UNQ_Relation_kafedra_prep] UNIQUE NONCLUSTERED  ([ik_kaf], [itab_n], [ik_work_type], [ik_defence_fund], [ik_capacity]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Relation_kafedra_prep] ADD CONSTRAINT [FK_Relation_kafedra_prep_kafedra] FOREIGN KEY ([ik_kaf]) REFERENCES [dbo].[kafedra] ([ik_kaf])
GO
ALTER TABLE [dbo].[Relation_kafedra_prep] ADD CONSTRAINT [FK_Relation_kafedra_prep_Prepod] FOREIGN KEY ([itab_n]) REFERENCES [dbo].[Prepod] ([itab_n])
GO
